import { createApp } from 'vue'
// 路由
import router from './router'
import RePager from '@/components/re-pager'
//pinia
import { createPinia } from 'pinia'
import piniaPluginPersist from 'pinia-plugin-persist'
const pinia = createPinia()
pinia.use(piniaPluginPersist)

// element 3.0
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'

// 基础样式
import './assets/styles/base.scss'
// 公共样式
import './assets/styles/common.scss'

// 事件总线
import eventBus from 'vue3-eventbus'

import App from './App.vue'
const app = createApp(App)
// 引入ElementUI
app.use(ElementPlus, { zIndex: 1000 })
app.use(eventBus)
app.use(router).use(pinia).mount('#app')

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.component('RePager', RePager)
